<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div>
    <a href="index.jsp">首页</a>
    <!-- 根据用户是否登录，显示不同的内容 -->
    <c:if test="${sessionScope.user == null }">
        <a href="login.jsp">登录</a>
    </c:if>

    <c:if test="${sessionScope.user != null }">
        <span>${sessionScope.user.username}</span>
        <a href="modifyPwd.jsp">修改密码</a>
        <a href="user.do?action=logout">退出登录</a>
    </c:if>
</div>